/*
 * Copyright (C) 2011 Kulabuhov Michael, Kemerovo, Russia.
 *
 * See the LICENSE file for terms of use.
 */

#include <Wt/WText>
#include <Wt/WImage>
#include <Wt/WHBoxLayout>
#include <Wt/WVBoxLayout>
#include <Wt/WDate>
#include "wpersephonefooter.h"

WPersephoneFooter::WPersephoneFooter(WContainerWidget *parent)
  : WContainerWidget(parent)
{
  setStyleClass("footer_line");
  WHBoxLayout *hbox = new WHBoxLayout(this);
  hbox->setContentsMargins(8, 0, 8, 0);
  hbox->setSpacing(8);

  WVBoxLayout *vbox = new WVBoxLayout();
  vbox->setContentsMargins(0, 0, 0, 0);
  vbox->setSpacing(0);

  WString date = WDate::currentDate().toString("yyyy");
  vbox->addWidget(new WText(tr("copyright").arg(date)), 0, AlignCenter);
  vbox->addWidget(new WText(tr("footer-message")), 0, AlignCenter);

  WImage *img = new WImage("favicon.ico");
  img->setWidth(16);
  img->setHeight(16);

  hbox->addWidget(img, 1, AlignRight | AlignMiddle);
  hbox->addLayout(vbox, 0);
  hbox->addWidget(img, 1, AlignLeft | AlignMiddle);
}
